<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Edit your information</title>
</head>
<style type="text/css">
input {float:right;}
form {width:400px;}
</style>

<script language="javascript" src="template/fieldcheck.js"></script>

<body>

<p>Change User Information</p>
<form id="form1" name="form1" method="post" action="?action=user.edituser">
<input type="hidden" name="action" value="Sign Up" ></input>
<c:if test="${error}"><font color ="red"> Some error need to be fixed: </font><br /></c:if>
<c:if test="${invalidEmail}"><font color ="red">  o Invalid Email! </font><br /></c:if>
<c:if test="${wrongPass}"><font color ="red">  o Wrong Old Password! </font><br /></c:if>
<c:if test="${invalidPass}"><font color ="red">  o Invalid New Password! </font><br /></c:if>
<c:if test="${emailUnavailable}"><font color ="red">  o Email is already taken! </font><br /></c:if>
<c:if test="${dbError}"><font color ="red">  o DataBase Error! </font><br /></c:if>
<c:if test="${success}"><font color ="green">Information has been successfilly changed! </font><br /></c:if>
  <br />
  <p>
   User: <%=request.getSession(true).getAttribute("username") %><br />
   Email: <%= request.getAttribute("userCurrEmail") %><br />
   Full Name: <%= request.getAttribute("userFullName") %><br />
   </p>
 
   <p>
    <label>Old Password 
    <input style="width: 250px;" type="password" name="password" id="password" />
    </label>
  </p>
  <p>
    <label>Change Password
    <input style="width: 250px;" type="password" name="changedPassword" id="changedPassword" onblur="confirm_pass(document.getElementById('changedPassword'),document.getElementById('confirmPass'));" />
    </label>
  </p>
  <p>
    <label>Confirm Password 
    <input style="width: 250px;" type="password" name="confirmPass" id="confirmPass" onblur="confirm_pass(document.getElementById('changedPassword'),document.getElementById('confirmPass'));" />
    </label>
</p>
  <p>
    <label>Change E-mail
    <input style="width: 250px;" type="text" name="userEmail" id="userEmail"/>
    </label>
  </p>
  <p>&nbsp;</p>
  <p>
    <input style="margin-left:200px; float:none;" type="submit" name="change" id="change" value="Change" />
    <input style="margin-left:0px; float:none;" type="reset" name="resetAll" id="resetAll" value="Reset All" />
    
  </p>
  <p><a href="/tracnghiem/home" title="home" target="_self"> Home</a></p>
</form>
<p>&nbsp; </p>
</body>
</html>